<template>
  <div class="app-container">
    <el-card>
      <div class="top">
        <strong>关键字</strong>
        <el-input v-model="input"
                  placeholder="请输入内容"></el-input>
        <div class="rightdiv">
          <el-button @click="clearinput">清除</el-button>
          <el-button type="primary"
                     @click="searchinput">搜索</el-button>
        </div>
      </div>

      <randoms-list :search="this.input"
                    ref="searchinputs"></randoms-list>
    </el-card>
  </div>
</template>

<script>
import randomsList from '../components/randoms-list'
export default {
  components: {
    randomsList
  },
  data() {
    return {
      input: ''
    }
  },
  methods: {
    searchinput() {
      this.$refs.searchinputs.searchrandomslist()
    },
    clearinput() {
      this.input = ''
      this.$refs.searchinputs.getrandomslist()
    }
  }
}
</script>

<style scoped lang='less'>
.app-container {
  .top {
    padding-left: 30px;
    font-size: 15px;
    .el-input {
      margin-left: 10px;
      width: 500px;
    }
    .rightdiv {
      float: right;
    }
  }
}
</style>
